home *** CD-ROM | disk | FTP | other *** search
/ Internet Info 1994 March / Internet Info CD-ROM (Walnut Creek) (March 1994).iso / security / doc / clippings / 920505-04 < prev    next >
Encoding:
Text File  |  1992-06-04  |  2.2 KB  |  63 lines

  1. Newsgroups: alt.gopher,alt.security,comp.lang.postscript
  2. From: jgreely@morganucodon.cis.ohio-state.edu (J Greely)
  3. Subject: Re: Gopher PostScript data type would constitute a security hole
  4. In-Reply-To: wollman@UVM.EDU's message of Tue, 5 May 1992 18: 56:52 GMT
  5. Message-ID: <JGREELY.92May5175637@morganucodon.cis.ohio-state.edu>
  6. Organization: Ohio State University Computer and Information Science
  7. References: <92May4.112004edt.53306@watdragon.waterloo.edu>
  8.     <1992May5.033112.13853@menudo.uh.edu> <1992May5.161126.11521@rice.edu>
  9.     <1992May5.185652.6305@uvm.edu>
  10. Date: Tue, 5 May 1992 22:56:37 GMT
  11.  
  12. In article <1992May5.185652.6305@uvm.edu> wollman@UVM.EDU
  13.  (Garrett Wollman) writes:
  14. >In article <1992May5.161126.11521@rice.edu> riddle@is.rice.edu
  15. > (Prentiss Riddle) writes:
  16. >>GhostScript, the GNU PostScript interpreter on which GhostView is
  17. >>based, appears to implement these scary functions, and the author has
  18. >>not been responsive to our request that a "safe" mode be added to
  19. >>GhostScript.
  20.  
  21. The beauty of free software is that you can fix it yourself.  The
  22. beauty of the net is that you can find someone else to fix it for you
  23. :-).
  24.  
  25. [solution deleted]
  26. >How's that?
  27.  
  28. The following patch to gs_init.ps (2.4.1) amplifies on Garrett's idea,
  29. allowing you to say -DSAFE on the command line.  It disables
  30. renamefile, deletefile, and restricts the file operator to reading.
  31.  
  32. *** gs_init.ps.old    Tue May  5 16:50:40 1992
  33. --- gs_init.ps    Tue May  5 17:54:03 1992
  34. ***************
  35. *** 35,40 ****
  36. --- 35,41 ----
  37.   currentdict /NOPAUSE known   /NOPAUSE exch def
  38.   currentdict /QUIET known ASCIIOUT or   /QUIET exch def
  39.   currentdict /WRITESYSTEMDICT known   /WRITESYSTEMDICT exch def
  40. + currentdict /SAFE known /SAFE exch def
  41.   
  42.   % Acquire environment variables.
  43.   currentdict /DEVICE known not
  44. ***************
  45. *** 343,348 ****
  46. --- 344,356 ----
  47.   % Temporarily substitute it for the real `run'.
  48.   /.run /run load def
  49.   /run /run0 load def
  50. + % disable potentially-dangerous file operators
  51. + SAFE {
  52. +     /file {dup (r) eq {file} {pop pop} ifelse} bind odef
  53. +     /renamefile {pop pop} odef
  54. +     /deletefile {pop} odef
  55. + } if
  56.   
  57.   % If the user asked for ASCII output, read in the patches now.
  58.   ASCIIOUT { (gs_2asc.ps) run } if
  59. -- 
  60. J Greely (jgreely@cis.ohio-state.edu; osu-cis!jgreely)
  61.  
  62.